﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ClassLibrary1.Utils;

namespace NN行情接口一类库
{
    public partial class 行情接口一 : UserControl
    {
        public 行情接口一()
        {
            InitializeComponent();

            // 初始化
            Initialize();               //Initialize是初始化
        }      
        //把配置信息加载到行情接口一的【行情表格一】中
        public void Initialize()
        {
            ReadSettingFile();
        }
        // 读取配置文件
        public void ReadSettingFile()
        {
            IniFileUtil.IniFileName = "TradeX-L2.ini";    //TradeX-L2是配置文件夹名称

        string strHostName01 = string.Empty;
            string strIPAddress01  = string.Empty;
            string strPort01           = string.Empty;
            strHostName01 = IniFileUtil.ReadIniData("L2Host", "HostName01", "").Trim();
            strIPAddress01  = IniFileUtil.ReadIniData("L2Host", "IPAddress01",  "").Trim();
            strPort01           = IniFileUtil.ReadIniData("L2Host", "Port01",           "0").Trim();

        string strHostName02 = string.Empty;
        string strIPAddress02 = string.Empty;
        string strPort02 = string.Empty;
        strHostName02 = IniFileUtil.ReadIniData("L2Host", "HostName02", "").Trim();
        strIPAddress02  = IniFileUtil.ReadIniData("L2Host", "IPAddress02", "").Trim();
        strPort02           = IniFileUtil.ReadIniData("L2Host", "Port02", "0").Trim();

        string strHostName03 = string.Empty;
        string strIPAddress03 = string.Empty;
        string strPort03 = string.Empty;
        strHostName03 = IniFileUtil.ReadIniData("L2Host", "HostName03", "").Trim();
        strIPAddress03  = IniFileUtil.ReadIniData("L2Host", "IPAddress03", "").Trim();
        strPort03           = IniFileUtil.ReadIniData("L2Host", "Port03", "0").Trim();

        string strHostName04 = string.Empty;
        string strIPAddress04 = string.Empty;
        string strPort04 = string.Empty;
        strHostName04 = IniFileUtil.ReadIniData("L2Host", "HostName04", "").Trim();
        strIPAddress04  = IniFileUtil.ReadIniData("L2Host", "IPAddress04", "").Trim();
        strPort04           = IniFileUtil.ReadIniData("L2Host", "Port04", "0").Trim();
        }
    }

    
}
